﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;//
using System.Threading;//

namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {
        public Form1()
        {

            InitializeComponent();

            comboBox1.Items.Add("English");

            comboBox1.Items.Add("Bulgarian");

            comboBox1.SelectedIndex = 0;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Icon = IDE_week2_Forms_project.Properties.Resources.Icon1;
        }

        private void button2_Click(object sender, EventArgs e)
        {

            Form form2 = new Form();
            form2.Show();
            form2.Icon = IDE_week2_Forms_project.Properties.Resources.Icon2;
        }


        private void button4_Click(object sender, EventArgs e)
        {
            this.Icon = default(Icon);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];
        }


        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox1.SelectedItem.ToString() == "English")
            {

                ChangeLanguage("en");

            }

            else if (comboBox1.SelectedItem.ToString() == "Bulgarian")
            {

                ChangeLanguage("bg-BG");

            }


        }



        private void ChangeLanguage(string lang)
        {

            foreach (Control c in this.Controls)
            {

                ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));

                resources.ApplyResources(c, c.Name, new CultureInfo(lang));

            }
        }
        private void button5_Click(object sender, EventArgs e)
        {

        }
    }
}
